In a low-pass RL filter (a filter that passes signals with low frequencies), the ratio of the magnitudes of the voltages is given by:
where ω is the frequency of the input signal.
Write a user-defined MATLAB function that calculates the magnitude ratio. For the function name and arguments, use RV = LRFilt (R, L, w). The input arguments are R, the size of the resistor inn (ohms); L, the size of the capacitor in H (Henry); and w, the frequency of the input signal in rad/s. Write the function such that w can be a vector.
Write a program in a script file that uses the LRFilt function to generate a plot of RV as a function of ω for 10 < ω < 106 rad/s. The plot has a logarithmic scale on the horizontal axis (co). When the script file is executed, it asks the user to enter the values of R and L. Label the axes of the plot.
Run the script file with R = 600 Q, and L = 0.14 -
SOLUTION
Script file:
R=input('Please input the size of the resistor: ');
L=input('Please input the size of the inductor: ');
%can use logspace or explicitly create an appropriate array for w
power=1:.01:6;
w=10.^power;
Unlock the complete assignment
You are viewing the free preview. Purchase this assignment once to reveal the complete resource.
Secure checkout is completed by Stripe.